package com.jerei.store.entity;

import java.util.Objects;

public class TableCart extends BaseEntity{
    private static final long serialVersionUID = -5602698185107572211L;
    private Integer cid;  //购物车数据id
    private Integer uid;    //用户id
    private Integer pid;    //商品id
    private Integer num;    //商品数量
    private long price;     //将商品加入到购物车时的价格

    public Integer getCid() {
        return cid;
    }

    public void setCid(Integer cid) {
        this.cid = cid;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public long getPrice() {
        return price;
    }

    public void setPrice(long price) {
        this.price = price;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TableCart tableCart = (TableCart) o;
        return cid.equals(tableCart.cid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(cid);
    }

    @Override
    public String toString() {
        return "TableCart{" +
                "cid=" + cid +
                ", uid=" + uid +
                ", pid=" + pid +
                ", num=" + num +
                ", price=" + price +
                "} " + super.toString();
    }
}
